package org.ling.xuan.dialog;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.components.JBTextField;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class TestDialog extends DialogWrapper {
    private final JBPanel jbPanel;
    private final JBTextField textField;

    public TestDialog(@Nullable Project project, boolean canBeParent) {
        super(project, canBeParent);
        setTitle("Setting Project");
        textField = new JBTextField();
        jbPanel = new JBPanel();
        jbPanel.add(textField);
        init();
    }

    @Override
    protected @Nullable JComponent createCenterPanel() {
        return jbPanel;
    }

    public String getInput() {
        return textField.getText();
    }
}
